import request from '@/utils/request.js'

export function getCompanyInfo(id) {
  return request({
    url: `/company/${id}`,
    method: 'get'
  })
}

/**
 * 获取角色列表
 * ***/
export function getRoleList(params) {
  return request({
    url: '/sys/role',
    params

  })
}
// 新增角色
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data

  })
}

export function getRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'

  })
}

export function editRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data

  })
}

export function delRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'

  })
}
// 给角色分配权限
export function assignPerm(data) {
  return request({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data

  })
}

